{% extends "base.html" %}
{% block title %}相册{% endblock %}
{% block content %}
<div style="margin:30px;">
<div class="list">
<ul>
{% for image in images%}
<li >
<p class="cont">
<a href="{{ image.path }}" title="{{ image.desc}}" class="thickbox" rel="gallery-plants"><img src="{{ image.t_path}}" alt="plant1" /></a> 
</p>
<p class="name"><span>{{ image.desc }}</span></p>
</li>
{% endfor %}
</ul>
</div>
</div>
{% if user.is_superuser %}
<div id="uploader">  
    <form id="upload" enctype="multipart/form-data" action="/photo/upload/" method="post">  
        <input id="file" name="file" type="file">  
        </br>
        <textarea id="desc" name="desc" row="10" cols="40" ></textarea>
        </br>
        <input type="submit" value="Upload">  
    </form>  
</div>  
{% endif%}

                          <div class="tabbed-content post-tabs clear-block" id="post-tabs">

  <!-- tab navigation (items must be in reverse order because of the tab-design) -->
                            <div class="tabs-wrap clear-block">
                                <ul class="tabs" style="width:780px">
                                    <li class="comments active"><a href="#section-comments"><span>评论（{{ comments.count}}）</span></a></li>  </ul>
                            </div>
                          </div>
                          
                          <div class="sections">

<div class="section clear-block" id="section-comments">

         <div id="comments-wrap">
      <div class="clear-block">
       <ul id="comments" class="comments">
        {% for comm in comments%}
  <!-- comment entry -->
  <li class="comment even thread-even depth-1 withAvatars reader name-will" id="comment-5">
    <div class="comment-head comment odd alt thread-odd thread-alt depth-1 withAvatars reader name-will">

      <div class="avatar-box"><img alt="" src="/site_media/pic/astro.jpg" class="avatar avatar-48 photo" height="48" width="48"></div>      <div class="author">
       
        <span class="by"><a class="delete-style comment-id">#{{ forloop.counter }}</a> <b class="comment-author" id="comment-author-5"> {{ comm.name}} </b> </span>
        <br>
        {{ comm.created|date:"Y/m/d" }}      
        {%if user.is_superuser%}
        <a href="/photo-comment/{{comm.id}}/delete" class="delete-style" style="float:right">删除</a>
        {% endif %}
        </div>
    </div>
    <div class="comment-body clear-block" id="comment-body-5">
            <div class="comment-text"><p>{{ comm.content }}</p>
</div>
      <a id="comment-reply-5"></a>
    </div>
</li>
{% endfor %}
       </ul>
      </div>
          </div>
          <div class="comment-form " id="respond">
          
                      <h2>Leave a Reply</h2>
          {%for field in comment%}
         <p>{{field}}{{ field.label_tag }}</p>
          {% endfor %}
            <input type="submit" value="提交评论" id="submit_comment" kind="photo"/>
          </div>
 </div>
{% endblock %}